package com.example.armmvvm.ui.constraint.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.armmvvm.R

/**
 *
 * 包名：com.example.armmvvm.ui.constraint.adapter
 * 文件描述：
 * 创建人：yanghaozhang
 * 创建时间：2023/1/5 9:16
 * 修改人：
 * 修改时间：
 * 修改备注：
 * @Version:1.0
 */
class SimpleAdapter private constructor(dataList: MutableList<String>) :
    BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_normal_text, dataList) {

    companion object {
        fun getAdapter(itemCount: Int = 51): SimpleAdapter {
            return SimpleAdapter(getDataList(itemCount))
        }

        private fun getDataList(itemCount: Int): MutableList<String> {
            return (0..itemCount).map {
                Char(it % 26 + 65).toString()
            }.toMutableList()
        }
    }

    override fun convert(holder: BaseViewHolder, item: String) {
        holder.setText(R.id.tvItemText, item)
    }
}
